#include <bits/stdc++.h>
using namespace std;
typedef multimap<int,greater<int>> inSet;
typedef multimap<int,greater<int>>::iterator setIter;
void GetLeastNumber(const vector<int>& data,inSet& leastNumber,int k)
{
    leastNumber.clear();
    if(k<1||data.size()<k)
        return;
    for(auto i:data)
    {
        if(leastNumber.size()<k)
            leastNumber.insert(i);
        else{
            auto iter = leastNumber.begin();
            if(i<*(leastNumber.begin())){
                leastNumber.erase(iter);
                leastNumber.insert(i);
            }
        }
    }
}
int main() {
    vector<int> data = {1,5,7,3,4,8,6};
    GetLeastNumber(data,,3);
    return 0;
}